/* GSManufactureAddInitAction.java
 *
 * Project/Product: JZCG-XMBUS
 *
 * Modify Information:
 * =============================================================================
 *   Author	Date       Description
 *   ----------	---------- ---------------------------------------------------
 *   peng.ning	2008-9-28	First release
 *
 * Licensed Materials - Property of APEP
 * =============================================================================
 *    (C) COPYRIGHT Shanghai Auto Mart E-Procurement Co., Ltd. 2007 - 2008
 *    All Rights Reserved.
 *
 *    This software is the confidential and proprietary information of
 *    Shanghai Auto Mart E-Procurement Co., Ltd. ("Confidential Information").
 *    You shall not disclose such Confidential Information and shall use it only
 *    in accordance with the terms of the license agreement you entered into 
 *    with Shanghai Auto Mart E-Procurement Co., Ltd.
 *
 * Noties:
 * =============================================================================
 * 
 */

package com.hitrust.gs.action;

import com.hitrust.gs.business.GSManufactureProcessor;
import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.lib.GSLogWriter;
import com.hitrust.gs.service.GSBaseAction;
import com.hitrust.gs.service.GSBaseForm;
import com.hitrust.gs.util.exception.GSException;

public class GSModifyManufactureAddInitAction extends GSBaseAction {

    /* (non-Javadoc)
     * @see com.hitrust.gs.service.GSBaseAction#execute(com.hitrust.gs.service.GSBaseForm)
     */
    public String execute(GSBaseForm aForm) throws Exception {
        // TODO Auto-generated method stub
        try {
            GSManufactureProcessor tGSManufProcessor = new GSManufactureProcessor();
            // 产生产品编号
            String manufactureid = tGSManufProcessor.getManufactureId();
            // 产品种类
            tGSManufProcessor.getManufactureOfLevel(aForm);
            //增加配置文件 判断湖南巴士计划价
            if(GSBaseConstants.PLANPRICE.equals("true")){
                aForm.getRequest().setAttribute("isPlanprice", "1");
            }else{
                aForm.getRequest().setAttribute("isPlanprice", "0");
            }
            aForm.getRequest().setAttribute("manufactureid", manufactureid);
        } catch (Exception e) {
            GSLogWriter.error(this, e.toString());
            aForm.getRequest().setAttribute("action", "A400301.do");
            throw new GSException(GSException.E19994, GSException.E19994);
        }
        return GSBaseConstants.FORWARD_SUCCESS;
    }

}
